-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] console-operator based on client-go #2
base: master
Are you sure you want to change the base?
[WIP] console-operator based on client-go #2
Conversation
@enj for all the review fun :) |
README.md
Outdated
|
||
```shell | ||
cd "${GOPATH}/src/github.com/enj/example-operator" | ||
An operator for OpenShift Console built using the operator-sdk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
dev_delete_all.sh
Outdated
|
||
FILE=examples/cr.yaml | ||
echo "creating ${FILE}" | ||
oc create -f $FILE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick copy paste, haven't tested that one yet.
obviously :)
String = fmt.Sprintf("ConsoleOperator %s", Raw) | ||
) | ||
|
||
func NewVersion() *cobra.Command { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not useful - you need git
info like pkg/console/version/version.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, quick stub in, ill have to look into how that is done & how it maps to our releases since we want things formatted specifically.
pkg/console/starter/starter.go
Outdated
|
||
// only watch a specific resource name | ||
tweakListOptions := func(options *v1.ListOptions) { | ||
options.FieldSelector = fields.OneTermEqualSelector("metadata.name", operator.ResourceName).String() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you will need to figure out if you can actually only watch a single name since you had multiple object names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, or if i need more than one tweakListOptionsFor____
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You would need to explicitly create different informers since there is no OR
in field selectors. It would likely be simpler to filter at the queue.
pkg/console/starter/starter.go
Outdated
} | ||
|
||
func (p *operatorStatusProvider) CurrentStatus() (operatorv1alpha1.OperatorStatus, error) { | ||
instance, err := p.informers.Console().V1alpha1().Consoles().Lister().Consoles(operator.TargetNamespace).Get(operator.ResourceName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems to work...
- Temporarily drop ApplyRoute() to more carefully GetOrCreate route - ensures we don't stomp on the Spec.host - Update Secret to manually create encoded secret - ApplySecret() from library-go ignores Spec.StringData - PR this to library-go in future - Stub in func for CR.Status via Sync loop - will be a follow-up PR - Stub in some specific status fields on Cr.Status - will be a follow-up PR
…s to extract 'Stub'
Renamed all occurance of "example" to "console". Regenerate pkg/generated/